
public class ThreadDemo3 {
    //1.实现匿名内部类,  创建Thread的子类对象
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(){
            @Override
            public void run() {
                System.out.println("使用匿名类创建 Thread 子类对象");
            }

        };
        //启动线程
       t.start();
       while(true){
           Thread.sleep(1000);
           System.out.println("运行maim");
       }
    }
}
